from itertools import count

def prime(n):
    for i in range(2, (n// 2)+1):
        if n % i == 0:
            return False
    else:
        return True

def prime_closet_to(n):
    for i in count(n):
        if prime(i):
            x = i
            dx = x - n
            break
    for k in count(n - 1, 1):
            if prime(k):
                y = k
                dy = n - y
                break
    ret = x if dx < dy else y
    return ret

c=input('введите 3 слова').split()
print(c)
m=['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
print(m)
ch=0
for k in c:
    for i in range(0,10):
        if k == m[i]:
            ch=(ch+i)*10
ch=ch//10
print(ch)
if ch < 100 or ch > 999:
    print("wrong_input")

else:
    print("самое болизкое простое число:", prime_closet_to(ch))
